home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / nt / dirent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  1.7 KB  |  61 lines

  1. /*
  2.  *  direct.h    Defines the types and structures used by the directory routines
  3.  *
  4.  */
  5. #ifndef _DIRENT_H_incl
  6. #define _DIRENT_H_incl
  7.  
  8. #ifdef __WATCOMC__
  9. #include <direct.h>
  10.  
  11. #else
  12.  
  13. #ifdef __cplupplus
  14. extern "C" {
  15. #endif
  16.  
  17. #include <sys/types.h>
  18.  
  19. #define NAME_MAX        255             /* maximum filename for HPFS or NTFS */
  20.  
  21. typedef struct dirent {
  22.     void*    d_handle;
  23.     unsigned    d_attr;                 /* file's attribute */
  24.     unsigned short int d_time;          /* file's time */
  25.     unsigned short int d_date;          /* file's date */
  26.     long        d_size;                 /* file's size */
  27.     char        d_name[ NAME_MAX + 1 ]; /* file's name */
  28.     unsigned short d_ino;               /* serial number (not used) */
  29.     char        d_first;                /* flag for 1st time */
  30. } DIR;
  31.  
  32. #ifndef _A_NORMAL
  33. #define _A_NORMAL       0x00    /* Normal file - read/write permitted */
  34. #define _A_RDONLY       0x01    /* Read-only file */
  35. #define _A_HIDDEN       0x02    /* Hidden file */
  36. #define _A_SYSTEM       0x04    /* System file */
  37. #define _A_VOLID        0x08    /* Volume-ID entry */
  38. #define _A_SUBDIR       0x10    /* Subdirectory */
  39. #define _A_ARCH         0x20    /* Archive file */
  40. #endif //_A_NORMAL_
  41.  
  42. extern int      chdir( const char *__path );
  43. extern int      closedir( DIR * );
  44. /*
  45. extern char     *getcwd( char *__buf, unsigned __size );
  46. extern unsigned _getdrive( void );
  47. extern unsigned _getdiskfree( unsigned __drive, struct _diskfree_t *__diskspace);
  48. */
  49. extern int      mkdir( const char *__path );
  50. extern DIR      *opendir( const char * );
  51. extern struct dirent *readdir( DIR * );
  52. extern int      rmdir( const char *__path );
  53.  
  54. #ifdef __cplusplus
  55. };
  56. #endif
  57.  
  58. #endif  //__WATCOMC__
  59.  
  60. #endif //incl
  61.